#ifndef  BRKS_COMMON_EVENT_TYPE_H_
#define  BRKS_COMMON_EVENT_TYPE_H_

#include "glo_def.h"

typedef struct EErrorReason_ {
	i32 code;//相应代号
	const char* reason;//错误原因
}EErrorReason;

/* 事件ID*/
enum EventID
{
	EEVENTID_GET_MOBLIE_CODE_REQ		= 0x01,
	EEVENTID_GET_MOBLIE_CODE_RSP		= 0x02,

	//登录请求
	EEVENTID_LOGIN_REQ					= 0x03,
	EEVENTID_LOGIN_RSP					= 0x04,

	//充值请求
	EEVENTID_RECHARGE_REQ				= 0x05,
	EEVENTID_RECHARGE_RSP				= 0x06,

	//账户余额
	EEVENTID_GET_ACCOUNT_BALANCE_REQ	= 0x07,
	EEVENTID_ACCOUNT_BALANCE_RSP		= 0x08,

	//充值记录查询
	EEVENTID_LIST_ACCOUNT_RECORDS_REQ	= 0x09,
	EEVENTID_ACCOUNT_RECORDS_REP		= 0x10,

	//骑行记录查询
	EEVENTID_LIST_TRAVELS_REQ			= 0x11,
	EEVENTID_LIST_TRAVELS_REP			= 0x12,


	EEVENTID_EXIT_RSP					= 0xFE,
	//未知事件
	EEVENTID_UNKOWN						= 0xFF
};

/*相应的错误代号*/
enum EErrorCode
{
	ERRC_SUCCESS						= 200,//成功
	ERRC_USER_NOT_EXIST	                = 301,//用户不存在
	ERRC_INVALID_MSG					= 400,//无效的信息
	ERRC_INVALID_DATA					= 404,//无效的数据
	ERRC_METHOD_NOT_ALLOWED				= 405,//方法不允许
	ERRC_PROCCESS_FALIED				= 406,//程序失败
	ERRC_BIKE_IS_TOOK					= 407,//自行车就绪
	ERRC_BIKE_RUNNING					= 408,//没有自行车了
	ERRC_BIKE_IS_DAMGED					= 409,//自行车损坏

	ERR_NULL							= 0
};

//根据代号，返回代号描述

const char* getReasonByErrorCode(i32 code);


#endif